//基础列表页面，不含状态筛选与添加按钮
var basePage = require('../../../../common/BasePage');
var baseList = require('../../../../common/BaseList');
Page({
  behaviors: [basePage, baseList],

  /**
   * 页面的初始数据
   */
  data: {
    reqUrl: '/home/supplier/index',
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	  var reqData = {
	  	wh_id: getApp().globalData.warehouse.wh_id
	  }
	  this.setData({
	  	reqData: reqData
	  })
	  this.req_items()
  },
  init_val(val, index, arr) {
    val.thumb = this.get_thumb(val.logo);
	val.product_list.map(pdc=>{
		pdc.pdcImg=this.get_thumb(pdc.product_img)
	})
  },
  toStore(e){
  	// console.log(e)
  	var store=e.currentTarget.dataset.store
  	wx.navigateTo({
  		url: '/pages/store/storeInfo/storeInfo?supplier_id='+store.supplier_id
  	})
  },
  toGoods(e){
	var pdc=e.currentTarget.dataset.pdc
	wx.navigateTo({
		url: '/pages/goodsDetail/goodsDetail?pid='+pdc.pid+"&supplier_id="+pdc.supplier_id
	})
  }
})